package com.trxy.mapper;

import com.trxy.model.Detail;
import com.trxy.model.Porder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface PorderMapper {
    //新增的id 会反填入到这个Porder对象
    int create(Porder porder);

    int addDetail(Detail detail);

    List<Detail> details(int porderId);

    Porder selectByPrimaryKey(int porderId);

    int changeQuantity(@Param("porderId") Integer porderId,
                       @Param("productId")Integer productId,
                       @Param("target")int target);

    int commit(@Param("porderId") Integer porderId, @Param("total") double total,
               @Param("status") int status, @Param("outTradeNo") String outTradeNo);

    int changeStatus(@Param("outTradeNo") String outTradeNo, @Param("status")int status);

    Porder selectByOutTradeNo(String outTradeNo);
}